<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<%@ taglib uri='http://java.sun.com/jsp/jstl/core' prefix='c'%>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form" %>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@taglib prefix="t" tagdir="/WEB-INF/tags/general" %>



<c:set var="basePath" value="${pageContext.servletContext.contextPath}"/>
<t:template>
<div style ="background-color:white;">
			<form:form action="${basePath}/bank/ibank/transfer/domestic" commandName="transaction" method="post">
				<table >
					<tr class="m">
						<td style="width: 80px;"><label for="accountFrom">Choose account transfer from: </label></td>
						<td>
						 	<form:select path="accountFrom">
								<c:forEach items="${accounts}" var="account">
									<form:option value="${account[1]}" label="${account[1]} (${account[4]})" />
								</c:forEach>
							</form:select>
						</td>
						<td><p style="color: red;"><form:errors path="accountFrom" /></p></td>
					</tr>
					<tr class="m">
						<td style="width: 100px;"><label for="accountTo">Receiver: </label></td>
						<td>
						 	<form:input path="accountTo" />
						</td>
						<td><form:errors path="accountTo" /></td>
					</tr>
					<tr class="m">
						<td style="width: 50px;"><label for="transactionAmount">Amount: </label></td>
						<td><form:input path="transactionAmount" /></td>
						<td><form:errors path="transactionAmount" /></td>
					</tr>	
					<tr class="m">
						<td>Information to receiver:</td>
						<td><form:input path="transactionDetails" /></td>
						<td><form:errors path="transactionDetails" /></td>
					</tr>					
					<tr>
						<td></td>
						<td colspan="2"><input type="submit" value="Make transaction" /></td>
					</tr>
				</table>
			</form:form>
			
</div>	
</t:template>